<template>
<p class="item_box_c_title flex_sb">
    <span>司内联系人</span>
    <el-button plain type="primary" @click="openSnContactsDialog">选择</el-button>
</p>
<div class="item_box_c mb10">
    <el-table :data="contacts">
        <el-table-column label="联系人姓名" prop="empName" align="center"/>
        <el-table-column label="手机" prop="mobilPhone" align="center"/>
        <el-table-column label="邮箱地址" prop="outEmail" align="center"/>
        <el-table-column label="部门" prop="empDepartName" align="center"/>
        <el-table-column label="职位" prop="positionname" align="center"/>
        <el-table-column label="电话" prop="officePhone" align="center"/>
        <el-table-column label="传真" prop="fax" align="center"/>
        <el-table-column label="团队角色" prop="userRole" align="center"/>
        <el-table-column label="项目职责" prop="userDuty" align="center"/>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template #default="{ row }">
                <el-button link type="primary" @click="deleteRow(row.id)">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
</div>
<SnContactsDialog v-model:visible="contactsDialogVisible" @confirm="selection"/>
</template>
    
<script setup>
import SnContactsDialog from '@/views/customer/components/SnContactsDialog.vue'

  // 新增司内联系人
let contactsDialogVisible = ref(false)
const openSnContactsDialog = ()=>{
    contactsDialogVisible.value = true
}
const selection = (arr)=>{
    console.log(arr)
}
const contacts = reactive([
    {
        id: 1,
        empName: '张三',
        mobilPhone: '13212345678',
        outEmail: 'EMAIL',
        empDepartName: '武汉市分公司',
        positionname: '主管',
        officePhone: '6583658745',
        fax: '123123',
        userRole: '牵头人',
        userDuty: '项目经理',
    },
    {
        id: 2,
        empName: '张三',
        mobilPhone: '13212345678',
        outEmail: 'EMAIL',
        empDepartName: '武汉市分公司',
        positionname: '主管',
        officePhone: '6583658745',
        fax: '123123',
        userRole: '牵头人',
        userDuty: '项目经理',
    },
])

const deleteRow = (id) => {
    contacts.splice(contacts.findIndex(item => item.userId === id),1)
}
</script>

<style lang="scss" scoped>

</style>